package com.itheima.mapper;

import com.itheima.pojo.Brand;
import com.itheima.pojo.PageBean;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface BrandMapper {

    @Select("select * from tb_brand ")
    @ResultMap("brandResultMap")
    public List<Brand> selectAll();

    @Insert("insert into tb_brand values (null,#{brandName},#{companyName},#{ordered},#{description},#{status})")
    public void add(Brand brand);


    public void deleteByIds(@Param("ids") int[] ids);

    @Select("select * from tb_brand limit #{begin},#{count}")
    @ResultMap("brandResultMap")
    public List<Brand> selectByPage(@Param("begin") int begin,@Param("count") int count);


    public int selectTotalCountByCondition( Brand brand);

    public List<Brand> selectByPageAndCondition(@Param("begin") int begin,@Param("count") int count,@Param("brand") Brand brand);

    @Delete("delete from tb_brand where id = #{id}")
    public void deleteById(int id);


    public void updateById(Brand brand);
}
